package  com.songyl.patternLearn.ObserverPattern;


/**
 * 具体目标
 */
public class RegistryPlayer  extends Registry{

    //登录状态
    public boolean loginFlag=true;

    //生命值
    public float HP=100;

    //游戏状态 HP<=0  isAlive=false
    public boolean isAlive=true;


    public boolean isLoginFlag() {
        return loginFlag;
    }

    public void setLoginFlag(boolean loginFlag) {
        this.loginFlag = loginFlag;
    }

    public float getHP() {
        return HP;
    }

    public void setHP(float HP) {
        this.HP = HP;
    }

    public boolean isAlive() {
        return loginFlag && HP>0;
    }

    public void setAlive(boolean alive) {
        isAlive = alive;
    }
}
